package Euclid;

public abstract class ActiveVarType extends VarType {
	
	public void activate() {
	}

	@Override
	public VarType add(VarType o) {
		if (o instanceof ErrorVarType)
			return o;
		else
			return new ErrorVarType("Operation $+$ unsupported on type " + getClass());
	}

	@Override
	public String closeFormula() {
		return "?";
	}

	@Override
	public VarType div(VarType o) {
		if (o instanceof ErrorVarType)
			return o;
		else
			return new ErrorVarType("Operation $\\div$ unsupported on type " + getClass());
	}

	@Override
	public VarType mod(VarType o) {
		if (o instanceof ErrorVarType)
			return o;
		else
			return new ErrorVarType("Operation mod unsupported on type " + getClass());
	}

	@Override
	public VarType mult(VarType o) {
		if (o instanceof ErrorVarType)
			return o;
		else
			return new ErrorVarType("Operation $\\times$ unsupported on type " + getClass());
	}

	@Override
	public VarType negate() {
		return new ErrorVarType("Operation $-$ unsupported on type " + getClass());
	}

	@Override
	public VarType not() {
		return new ErrorVarType("Operation $\\sim$ unsupported on type " + getClass());
	}

	@Override
	public VarType pow(VarType o) {
		if (o instanceof ErrorVarType)
			return o;
		else
			return new ErrorVarType("Operation $x^y$ unsupported on type " + getClass());
	}

	@Override
	public VarType subtract(VarType o) {
		if (o instanceof ErrorVarType)
			return o;
		else
			return new ErrorVarType("Operation $-$ unsupported on type " + getClass());
	}

}
